home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / games / IndiZone / vroom / vroom.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  4.2 KB  |  133 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #ifndef _VROOM_H_
  18. #define _VROOM_H_
  19.  
  20. #include <X11/Intrinsic.h>
  21. #include <X11/StringDefs.h>
  22. #include <Xm/Xm.h>
  23.  
  24. #define    CAR_WIPE_OUT        0x001
  25. #define    CAR_FINISHED        0x002
  26. #define    CHANGE_LANE_LEFT    0x004
  27. #define    CHANGE_LANE_RIGHT    0x008
  28. #define    WIPE_OUT_SPEED        0x010
  29. #define    WIPE_OUT_OFF_ROAD    0x020
  30. #define    WIPE_OUT_COLLISION    0x040
  31. #define    CAR_BUMP        0x080
  32. #define    CAR_SKID        0x100
  33.  
  34. #define    CHANGE_LANES        (CHANGE_LANE_LEFT | CHANGE_LANE_RIGHT)
  35. #define    WIPE_OUT_REASON        (WIPE_OUT_SPEED | WIPE_OUT_OFF_ROAD | \
  36.                     WIPE_OUT_COLLISION)
  37.  
  38. #define    CAR_RACING( c )    (((c)->status & (CAR_WIPE_OUT | CAR_FINISHED)) == 0)
  39.  
  40. #define    VROOM_TRIAL_LAPS    3
  41.  
  42. #define    LANE_WIDTH        (75.0f)
  43. #define    RAIL_WIDTH        (15.0f)
  44.  
  45. #define    MAX_LOD            (4)
  46.  
  47. #define    MAX_PLAYERS        (8)
  48.  
  49. #define    MAX_COURSE_NAME        40
  50. #define    MAX_COURSE_SIZE        150
  51.  
  52. #define    TOP_SPEED        (1500.0f)
  53.  
  54. #define    MINFUNC(x,y)    ( (x) < (y) ? (x) : (y) )
  55. #define    MAXFUNC(x,y)    ( (x) > (y) ? (x) : (y) )
  56. #define    ABSFUNC(x)    ( (x) < 0 ? -(x) : (x) )
  57.  
  58. #define    MAX_RACE_TIME        (99.0f*60.0f+59.99f)
  59. #define    VROOM_NAMELEN    (32)
  60. #define    VROOM_MSGLEN    (64)
  61.  
  62. #define    VROOM_NO_MODE    (0)
  63. #define    VROOM_SOLO    (1)
  64. #define    VROOM_TEAM    (2)
  65. #define    VROOM_WATCH    (3)
  66.  
  67. #define    VROOM_WP_SOLO        0x0001
  68. #define    VROOM_WP_TIME_GRAPHICS    0x0002
  69. #define    VROOM_WP_FIND_SERVER    0x0004
  70. #define    VROOM_WP_RUN_SERVER    0x0008
  71. #define    VROOM_WP_RUN_CLIENT    0x0010
  72. #define    VROOM_WP_READ_SERVER    0x0020
  73. #define    VROOM_WP_SOLO_TRIAL    0x0040
  74.  
  75. #define    INTRO_SFX    0
  76. #define    TONE_SFX    1
  77. #define    START_SFX    2
  78. #define    RESTART_SFX    3
  79. #define    CRASH_SFX    4
  80. #define    ALERT_SFX    5
  81. #define    COLLIDE_SFX    6
  82. #define    CHEERS_SFX    7
  83. #define    LASTLAP_SFX    8
  84.  
  85. typedef struct {
  86.         int    place ;
  87.         float    x ;
  88.         float    y ;
  89.         float    z ;
  90.         float    thetaDeg ;
  91.         float    roll ;
  92.         float    headingDeg ;
  93.         float    color[3] ;
  94.         } PlayerStruct ;
  95.  
  96. /* BEGIN PROTOTYPES vroom.c */
  97. void        aboutCB( Widget w, XtPointer clientData, XtPointer callData ) ;
  98. Widget      addMenuPushButton( Widget parent, char *label, Arg args[], int n,
  99.                 XtCallbackProc cb, XtPointer callData ) ;
  100. void        busyCursor( void ) ;
  101. void        controlIntroWindow( int show ) ;
  102. void        controlMainWindow( int show ) ;
  103. void        exitCB( Widget w, XtPointer clientData, XtPointer callData ) ;
  104. char *      extractNormalString( XmString cs ) ;
  105. void        fatalError( char *fmt, ... ) ;
  106. int         getTtl( void ) ;
  107. void        helpCB( Widget w, XtPointer clientData, XtPointer callData ) ;
  108. char *      longRaceTimeString( float t, int *length ) ;
  109. void        main( int argc, char **argv ) ;
  110. void        minorError( XtCallbackProc callback, XtPointer userData,
  111.                 char *fmt, ... ) ;
  112. void *      myMalloc( size_t size ) ;
  113. void *      myRealloc( void *ptr, size_t size ) ;
  114. float       normalizeVec2( float v[2] ) ;
  115. void        PopDownCB( Widget callingWidget, Widget doomedWidget,
  116.                 caddr_t call_data ) ;
  117. void        popUpCB( Widget w, XtPointer clientData, XtPointer callData ) ;
  118. void        postInfo( XtCallbackProc callback, XtPointer userData, char *fmt,
  119.                 ... ) ;
  120. void        printCB( Widget w, XtPointer clientData, XtPointer callData ) ;
  121. char *      raceTimeString( float t, int *length ) ;
  122. Boolean     randomChoice( float threshhold ) ;
  123. void        setAdminForm( Widget newForm ) ;
  124. void        setMessage( char *fmt, ... ) ;
  125. void        setWorkProc( long wpMask, int mode ) ;
  126. void        showRaceHelpCB( Widget w, XtPointer clientData,
  127.                 XtPointer callData ) ;
  128. void        startTimeTrials( int skipTrial ) ;
  129. void        unbusyCursor( void ) ;
  130. /* END PROTOTYPES vroom.c */
  131.  
  132. #endif /* !_VROOM_H_ */
  133.